﻿CREATE proc [dbo].[danhmucTaiKhoan_Them]  
@ma_tk varchar(50),  
@loai_tk nvarchar(20),  
@ten_tk nvarchar(255),  
@input bit,  
@congno bit,  
@cap nvarchar(50),  
@capduoi bit,  
@captren nvarchar(50)  
as  
if exists(select * from DM_taikhoan   Where ma_tk =@ma_tk  or loai_tk =@loai_tk   )  
begin  
select ErrCode=0  
end  
else  
begin  
insert into DM_taikhoan (ma_tk,loai_tk,ten_tk,input,congno,cap,capduoi,captren )  
    values(@ma_tk,@loai_tk,@ten_tk,@input,@congno,@cap,@capduoi,@captren)   
select ErrCode=1  
end  